<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>yqTextNCheckBox</title>
    <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
    <uieip type="file" value="css" src="/yqwin/css/yqwin.min" cache="false"></uieip>
    <uieip type="file" value="js" src="/yqwin/data/yqwin.min" cache="false"></uieip>
</head>

<body>
    <h1>ui_type=13 yqTextNCheckBox</h1>
    <input id="tb" type="text" style="width:280px;">
    <p></p>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:setValue()">setValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:clearRow()">clear</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:getValue()">getValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(true)">isEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(false)">isEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:destroy()">destroy</a>

    <h1>ui_type=20 CSV</h1>
    <input id="tb_csv" type="text" style="width:280px;">
    <p></p>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_setValue()">setValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_clearRow()">clear</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_getValue()">getValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_isEdit(true)">isEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_isEdit(false)">isEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_destroy()">destroy</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_showedit(true)">showedit true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:csv_showedit(false)">showedit false</a>

    <h1>ui_type=21 Func</h1>
    <input id="tb_func" type="text" style="width:280px;">
    <p></p>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:func_setValue()">setValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:func_clearRow()">clear</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:func_getValue()">getValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:func_isEdit(true)">isEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:func_isEdit(false)">isEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:func_destroy()">destroy</a>

    <script>
        $(function () {
            $("#tb").yqTextNCheckBox({
                lists: [
                    { no: 1, name: "name-1111" },
                    { no: 2, name: "name-2222" },
                    { no: 3, name: "name-3333" },
                    { no: 4, name: "name-44444444" },
                    { no: 5, name: "name-55555" },
                    { no: 6, name: "name-6666666666" },
                    { no: 7, name: "name-七七七七七七七" },
                    { no: 8, name: "name-八八八八八八八八八八" }],
                value: "1,2",
                blank: true,
                isEdit: true,   //可编辑
                editModeW: 400, //模态编辑器宽度 格式为 800（数字）
                editModeH: 240, //模态编辑器高度 格式为 600（数字）
                beforeChange: function (value, callback) {
                    console.log(value);
                    callback(true, value);
                }
            });

            $("#tb_csv").yqTextCSV({
                ui_type: 2,  //输入值类型 2:文本 4:日期 9:numberBox 10:numberSpinner,11timeSpinner,12:dateTimeSpinner
                ui_mask: {}, //掩码
                separator: ",", //分隔符
                value: "aaa,bbb,ccc", //默认值
                isEdit: true,
                isAdd: true,
                isDel: true,
                isMove: true,

                editModeW: "33%", //模态编辑器宽度 格式为 800（数字）
                editModeH: 300, //模态编辑器高度 格式为 600（数字）
                beforeBindingTitle: function (titles, callback) {
                    callback(titles);
                }, //标题绑定前
                afterBindingTitle: function () { },   //标题绑定后

                beforeEditShow: function (edit_type, options, callback) {
                    callback(true, edit_type, options);
                }, //弹出框显示前

                beforeAdd: function (rows, row, callback) {
                    callback(row);
                },
                afterChange: function (rows) {

                },
            });

            $("#tb_func").yqTextFunc({
                value: "13123123-13123123-13123123-13123123-1312312313123123-13123123", //默认值
                isEdit: true,
                beforeBindingTitle: function (callback) {
                    callback();
                }, //标题绑定前
                afterBindingTitle: function () { },   //标题绑定后
                afterChange: function (rows) {

                },
            });
        });

        function setValue() {
            $("#tb").yqTextNCheckBox("setValue", "1,3,5");
        }

        function clearRow() {
            $("#tb").yqTextNCheckBox("clear");
        }

        function getValue() {
            var val = $("#tb").yqTextNCheckBox("getValue");
            console.log("getValue", val);
        }

        function isEdit(tf) {
            $("#tb").yqTextNCheckBox("isEdit", tf);
        }

        function destroy() {
            $("#tb").yqTextNCheckBox("destroy");
        }
        //-----------------------------
        function csv_setValue() {
            $("#tb_csv").yqTextCSV("setValue", "name-1111,name-2222");
        }

        function csv_clearRow() {
            $("#tb_csv").yqTextCSV("clear");
        }

        function csv_getValue() {
            var val = $("#tb_csv").yqTextCSV("getValue");
            console.log("getValue", val);
        }

        function csv_isEdit(tf) {
            $("#tb_csv").yqTextCSV("isEdit", tf);
        }

        function csv_destroy() {
            $("#tb_csv").yqTextCSV("destroy");
        }

       function csv_showedit(tf){
            $("#tb_csv").yqTextCSV("showEdit", tf);
       }
        //---------------------------------
        function func_setValue() {
            $("#tb_func").yqTextFunc("setValue", "name-1111,name-2222");
        }

        function func_clearRow() {
            $("#tb_func").yqTextFunc("clear");
        }

        function func_getValue() {
            var val = $("#tb_func").yqTextFunc("getValue");
            console.log("getValue", val);
        }
        function func_isEdit(tf) {
            $("#tb_func").yqTextFunc("isEdit", tf);
        }

        function func_destroy() {
            $("#tb_func").yqTextFunc("destroy");
        }
    </script>
</body>

</html>